﻿#ifndef _BASE_DEVICE_VIDEO_
#define _BASE_DEVICE_VIDEO_

#include <string>
#include "xcast_handler.h"

namespace Device {
namespace Video {
namespace Listener {
class Interface {
public:
  virtual ~Interface() {}

  virtual void OnAddCamera(const char* device_id, bool add) = 0;
  
  virtual void OnCameraUpdate(const char* device_id, int state) = 0;
  
  virtual void OnCameraPreview(const char* device_id, uint8_t* data, uint32_t data_size, uint32_t format,
                  uint32_t width, uint32_t height) = 0;
};

void Add(Interface* listener);

void Remove(Interface* listener);
}

namespace XcastEvent {
  void OnAddCamera(const char* device_id, bool add);
  
  void OnCameraUpdate(const char* device_id, int state);

  void OnCameraPreview(const char* device_id, uint8_t* data, uint32_t data_size, uint32_t format,
                       uint32_t width, uint32_t height);
  }

  bool IsSelected(const char* device_id);

  int Select(const char* device_id);

  int Preview(const char* device_id, bool on);
  
  const std::string GetSelectedCamera();
}
}

#endif
